package org.go.smart.statistics;

import java.util.Date;

public class HeaterStatisticsEntry {
	
	private Date startDate;
	private Date endDate;
	
	public HeaterStatisticsEntry () {
		this.setStartDate(new Date());
	}
	
	public long getDuration () {
		if (getEndDate() == null) {
			return 0;
		}
		return (getEndDate().getTime() - getStartDate().getTime()) / 1000;
	}

	public void endEntry() {
		this.setEndDate(new Date());
	}

	public Date getStartDate() {
		return startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

}
